<template>
  <div class="app-container">
    <router-view v-slot="{ Component, route }">
      <template v-if="route.meta.requiresLayout">
        <div class="app-layout">
          <app-sidebar />
          <div class="app-main">
            <app-header />
            <div class="app-content">
              <div class="content-wrapper">
                <app-breadcrumb />
                <component :is="Component" />
              </div>
            </div>
          </div>
        </div>
      </template>
      <template v-else>
        <component :is="Component" />
      </template>
    </router-view>
  </div>
</template>

<script setup lang="ts">
import AppHeader from '@/components/AppHeader.vue'
import AppSidebar from '@/components/AppSidebar.vue'
import AppBreadcrumb from '@/components/AppBreadcrumb.vue'
</script>

<style>
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
}

#app {
  height: 100%;
}

:root {
  --content-padding: 0px;
  --background-color: #f5f7fa;
  --text-primary: #303133;
  --text-regular: #606266;
  --text-secondary: #909399;
  --border-color: #e4e7ed;
  --header-height: 60px;
  --header-background: #ffffff;
  --sidebar-width: 220px;
  --sidebar-background: #001529;
  --sidebar-collapsed-width: 64px;
  --primary-color: #409EFF;
}

.app-container {
  height: 100%;
}

.app-layout {
  display: flex;
  height: 100%;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-content {
  flex: 1;
  overflow: auto;
  background-color: var(--background-color);
  padding: 16px;
}

.content-wrapper {
  height: 100%;
  /* max-width: 1440px; */
  /* margin: 0 auto; */
}
</style> 